package com.tudouji.project.quality.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.tudouji.framework.aspectj.lang.annotation.Excel;
import com.tudouji.framework.web.domain.BaseEntity;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 质检记录对象 qarecord
 *
 * @author tudouji
 * @date 2022-11-01
 */
@Data
public class Qarecord extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 主键 */
    private String guid;

    /** 货运单ID */
    @Excel(name = "货运单ID")
    private String foguid;

    /** 第n袋（顺序号，质检袋数，质检项列表展示的时候按照顺序号排序） */
    @Excel(name = "第n袋", readConverterExp = "顺=序号，质检袋数，质检项列表展示的时候按照顺序号排序")
    private Integer qanumbers;

    /** 总重量 */
    @Excel(name = "总重量")
    private BigDecimal totalweight;

    /** $column.columnComment */
    @Excel(name = "总重量")
    private BigDecimal item1weight;

    /** $column.columnComment */
    @Excel(name = "总重量")
    private BigDecimal item2weight;

    /** $column.columnComment */
    @Excel(name = "总重量")
    private BigDecimal item3weight;

    /** $column.columnComment */
    @Excel(name = "总重量")
    private BigDecimal item4weight;

    /** $column.columnComment */
    @Excel(name = "总重量")
    private BigDecimal item5weight;

    /** $column.columnComment */
    @Excel(name = "总重量")
    private BigDecimal item6weight;

    /** $column.columnComment */
    @Excel(name = "总重量")
    private BigDecimal item7weight;

    /** $column.columnComment */
    @Excel(name = "总重量")
    private BigDecimal item8weight;

    /** $column.columnComment */
    @Excel(name = "总重量")
    private BigDecimal item9weight;

    /** $column.columnComment */
    @Excel(name = "总重量")
    private BigDecimal item10weight;

    /** $column.columnComment */
    @Excel(name = "总重量")
    private BigDecimal item11weight;

    /** $column.columnComment */
    @Excel(name = "总重量")
    private BigDecimal item12weight;

    /** $column.columnComment */
    @Excel(name = "总重量")
    private BigDecimal item13weight;

    /** $column.columnComment */
    @Excel(name = "总重量")
    private BigDecimal item14weight;

    /** $column.columnComment */
    @Excel(name = "总重量")
    private BigDecimal item15weight;

    /** $column.columnComment */
    @Excel(name = "总重量")
    private BigDecimal item16weight;

    /** $column.columnComment */
    @Excel(name = "总重量")
    private BigDecimal item17weight;

    /** $column.columnComment */
    @Excel(name = "总重量")
    private BigDecimal item18weight;

    /** $column.columnComment */
    @Excel(name = "总重量")
    private BigDecimal item19weight;

    /** $column.columnComment */
    @Excel(name = "总重量")
    private BigDecimal item20weight;

    /** 合格重量 */
    @Excel(name = "合格重量")
    private BigDecimal okweight;

    /** 杂土重量=总重量-sum（质检项重量）-合格重 */
    @Excel(name = "杂土重量=总重量-sum", readConverterExp = "质=检项重量")
    private BigDecimal mixweight;

    /** 创建时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date createdate;

    /** 操作人 */
    @Excel(name = "操作人")
    private String operatorid;

    /** 最后更新时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "最后更新时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date lastupdate;

    private BigDecimal totalweightsum;
    private BigDecimal soilchkweight;
    private BigDecimal itemsamllweight;

    private Integer pknumssum;
    private BigDecimal okweightsum;
    private BigDecimal bigweightsum;
    private BigDecimal notokweightsum;
    private BigDecimal unqualifiedchkweight;

    private String key;

    /**
     * @param index 条目序号0
     * @return
     */
    public BigDecimal getItemWeight(Integer index) {
        BigDecimal itemweight = new BigDecimal(0);
        if (0 == index) {
            return item1weight;
        }
        if (1 == index) {
            return item2weight;
        }
        if (2 == index) {
            return item3weight;
        }
        if (3 == index) {
            return item4weight;
        }
        if (4 == index) {
            return item5weight;
        }
        if (5 == index) {
            return item6weight;
        }
        if (6 == index) {
            return item7weight;
        }
        if (7 == index) {
            return item8weight;
        }
        if (8 == index) {
            return item9weight;
        }
        if (9 == index) {
            return item10weight;
        }
        if (10 == index) {
            return item11weight;
        }
        if (11 == index) {
            return item12weight;
        }
        if (12 == index) {
            return item13weight;
        }
        if (13 == index) {
            return item14weight;
        }
        if (14 == index) {
            return item15weight;
        }
        if (15 == index) {
            return item16weight;
        }
        if (16 == index) {
            return item17weight;
        }
        if (17 == index) {
            return item18weight;
        }
        if (18 == index) {
            return item19weight;
        }
        if (19 == index) {
            return item20weight;
        }
        return itemweight;
    }
}
